package com.example.cheng.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class ErrorController {
    /**
     *  服务响应超时的回调
     * @return 错误码
     * */
    @RequestMapping("/fallback")
    public Object fallback () {
//        System.out.println("\nfallback成功执行\n");
        Map<String, Object> result = new HashMap<>();
        result.put("code", 0);
        result.put("msg", "服务器繁忙");
        result.put("state", false);
        return result;
    }
}
